from django.conf.urls import url

from . views import IndexViews,UserViews,TypesViews,GoodsViews,DingdanViews

urlpatterns = [
    #后台首页
    url(r'^$', IndexViews.index,name='myadmin_index'),
    #登录页面
    url(r'^login/$', IndexViews.adminlogin,name='myadmin_login'),
    #退出登录
    url(r'^logout/$', IndexViews.adminlogout,name='myadmin_logout'),
    #验证码请求的路由
    url(r'^vcode/$', IndexViews.verifycode,name='myadmin_vcode'),

    #管理员列表
    url(r'^auth/user/$', IndexViews.authuser,name='myadmin_authuser'),
    #管理员添加
    url(r'^authuser/add/$', IndexViews.authuseradd,name='myadmin_authuseradd'),
    #授权组列表
    url(r'^auth/group/$', IndexViews.authgroup,name='myadmin_authgroup'),
    url(r'^authgroup/add/$', IndexViews.authgroupadd,name='myadmin_authgroupadd'),
    url(r'^authgroup/edit/(?P<gid>[0-9]+)/$', IndexViews.authgroupedit,name='myadmin_authgroup_edit'),


    #会员管理
    url(r'^user/index/$' ,UserViews.index,name='myadmin_user_index'),
    url(r'^user/add/$', UserViews.add,name='myadmin_user_add'),
    url(r'^user/insert/$', UserViews.insert,name='myadmin_user_insert'),
    url(r'^user/delete/$', UserViews.delete,name='myadmin_user_delete'),
    url(r'^user/edit/(?P<uid>[0-9]+)/$', UserViews.edit,name='myadmin_user_edit'),
    url(r'^user/update/$', UserViews.update,name='myadmin_user_update'),


    #分类管理
    url(r'^types/index/$', TypesViews.index,name='myadmin_types_index'),
    url(r'^types/add/$', TypesViews.add,name='myadmin_types_add'),
    url(r'^types/insert/$', TypesViews.insert,name='myadmin_types_insert'),
    url(r'^types/delete/$', TypesViews.delete,name='myadmin_types_delete'),
    url(r'^types/update/$', TypesViews.update,name='myadmin_types_update'),


    # 商品管理
    url(r'^goods/index/$', GoodsViews.index,name='myadmin_goods_index'),
    url(r'^goods/add/$', GoodsViews.add,name='myadmin_goods_add'),
    url(r'^goods/insert/$', GoodsViews.insert,name='myadmin_goods_insert'),
    url(r'^goods/delete/(?P<gid>[0-9]+)/$', GoodsViews.delete,name='myadmin_goods_delete'),
    url(r'^goods/edit/(?P<gid>[0-9]+)/$', GoodsViews.edit,name='myadmin_goods_edit'),
    url(r'^goods/update/$', GoodsViews.update,name='myadmin_goods_update'),


    #订单管理
    url(r'^dingdan/index/$', DingdanViews.index,name='myadmin_dingdan_index'),
    url(r'^dingdan/edit/$', DingdanViews.edit,name='myadmin_dingdan_edit'),

]